package cn.com.dycc.topic_activity.controller;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import cn.com.dycc.common.controller.BaseController;
import cn.com.dycc.topic_activity.param.Pb_Activity_DeptParam;
import cn.com.dycc.topic_activity.service.Pb_Activity_DeptService;
import cn.com.dycc.util.JsonObjectResult;


@Controller
@RequestMapping("/topic_activity/activity_dept")
public class Pb_Activity_DeptController extends BaseController{
	
	@Resource
	private Pb_Activity_DeptService pb_Activity_DeptService;
	
	/**
	 * 新增专题活动关联党组织信息
	 * @param param
	 * @param session
	 * @param request
	 * @return
	 */
	@RequestMapping("/add.do")
	@ResponseBody
	public JsonObjectResult addPd_Activity_Enter(Pb_Activity_DeptParam param,HttpSession session,HttpServletRequest request){
		
		int d=pb_Activity_DeptService.addPb_Activity_Dept(param,request);
		String flag="成功导入数据条数为:"+d;
		return new JsonObjectResult(flag);		
	}
	
	/**
	 * 根据专题活动id查询其关联的所有党组织信息
	 * @param activity_id
	 * @param session
	 * @param request
	 * @return
	 */
	@RequestMapping("/adept.do")
	@ResponseBody
	public JsonObjectResult findPb_Activity_DeptPartById(String activity_id,HttpSession session,HttpServletRequest request){
		
		return pb_Activity_DeptService.findPb_Activity_DeptPartById(activity_id,request);		
	}

}
